Performance.registerGroup({
	name: "js.typeof"
});

Performance.registerTest({
	group: "js.typeof",
	name: "typeof: string",
	args: [250000, 500000, 1000000, 1500000],
	
	run: function(arg) {
		var v = "sasasak";
		
		while(arg--) {
			typeof v;
		}
	}
});

Performance.registerTest({
	group: "js.typeof",
	name: "typeof: object",
	args: [250000, 500000, 1000000, 1500000],
	
	run: function(arg) {
		var v = {a: "a", b: "b", c: "c", d: "d"};
		while(arg--) {
			typeof v;
		}
	}
});

Performance.registerTest({
	group: "js.typeof",
	name: "typeof: array",
	args: [250000, 500000, 1000000, 1500000],
	
	run: function(arg) {
		var v = ["a", "b", "c", "d"];
		while(arg--) {
			typeof v;
		}
	}
});

Performance.registerTest({
	group: "js.typeof",
	name: "instanceof: String",
	args: [250000, 500000, 1000000, 1500000],
	
	run: function(arg) {
		var v = new String("sasasak");
		while(arg--) {
			var value = v instanceof String;
		}
	}
});

Performance.Stubs.Class = function() {};
Performance.Stubs.Class.prototype = {};

Performance.registerTest({
	group: "js.typeof",
	name: "instanceof: Core.Storage",
	args: [250000, 500000, 1000000, 1500000],
	
	run: function(arg) {
		var v = new Performance.Stubs.Class();
		while(arg--) {
			var value = v instanceof Performance.Stubs.Class;
		}
	}
});